/* 太阳能发电系统监控界面 - 公共样式 */
:root {
  --primary-color: #0077cc;
  --secondary-color: #00aa55;
  --dark-color: #333;
  --light-color: #f8f9fa;
  --warning-color: #ff9900;
  --danger-color: #ff3333;
  --success-color: #00cc88;
  --border-radius: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

/* 暗色模式变量 */
:root.dark-mode {
  --primary-color: #4da6ff;
  --secondary-color: #33cc99;
  --dark-color: #e0e0e0;
  --light-color: #1a1a1a;
  --warning-color: #ffb366;
  --danger-color: #ff6666;
  --success-color: #33dd99;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --gradient-primary: linear-gradient(135deg, #4da6ff, #33cc99);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: #f0f2f5;
  color: var(--dark-color);
  line-height: 1.6;
  padding: 0;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

.solar-app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  background-color: #f0f2f5;
  min-height: 100vh;
}

.card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 24px;
  overflow: hidden;
}

h1,
h2,
h3,
h4 {
  margin-bottom: 16px;
  font-weight: 600;
}

h1 {
  font-size: 1.5rem;
  color: white;
}

h2 {
  font-size: 1.25rem;
  color: var(--primary-color);
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-weight: 500;
  transition: all 0.3s ease;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

/* 顶部导航栏 */
.app-header {
  position: relative;
  padding: 16px 20px;
  background: var(--gradient-primary);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  color: white;
  min-height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-title {
  position: relative;
  text-align: center;
}

.app-logo {
  width: 70px;
  height: 70px;
  object-fit: contain;
  position: absolute;
  top: -10px;
  left: -80px;
  z-index: 1;
}

h1 {
  margin: 0;
}

.last-update {
  font-size: 0.75rem;
  opacity: 0.9;
  position: absolute;
  bottom: 10px;
  right: 20px;
  z-index: 1;
}

/* 导航菜单 */
.nav-menu {
  display: flex;
  justify-content: space-around;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 12px 0;
  font-weight: 500;
  color: var(--dark-color);
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.nav-item.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.nav-item:hover {
  background-color: rgba(0, 119, 204, 0.05);
}

/* 弹出对话框 */
.dialog-overlay,
.alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.dialog-content,
.alert-content {
  background-color: white;
  border-radius: var(--border-radius);
  padding: 24px;
  width: 85%;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.dialog-buttons {
  display: flex;
  justify-content: flex-end;
  margin-top: 24px;
  gap: 12px;
}

.cancel-btn {
  background-color: #eee;
  color: #666;
}

.confirm-btn {
  background-color: var(--primary-color);
  color: white;
}

.alert-content {
  text-align: center;
}

.alert-icon {
  font-size: 2.5rem;
  color: var(--danger-color);
  margin-bottom: 16px;
}

.alert-btn {
  background-color: var(--primary-color);
  color: white;
  margin-top: 20px;
  padding: 10px 24px;
  width: 100%;
}

/* 暗色模式样式 */
.dark-mode {
  background-color: #121212 !important;
  color: #e0e0e0 !important;
}

.dark-mode .solar-app {
  background-color: #121212;
}

.dark-mode .card {
  background-color: #1e1e1e;
  color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-mode .nav-menu {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

.dark-mode .nav-item {
  color: #e0e0e0;
}

.dark-mode .nav-item:hover {
  background-color: rgba(77, 166, 255, 0.1);
}

.dark-mode .dialog-content,
.dark-mode .alert-content {
  background-color: #1e1e1e;
  color: #e0e0e0;
}

.dark-mode .cancel-btn {
  background-color: #333;
  color: #ccc;
}

.dark-mode h2 {
  color: var(--primary-color);
}

.dark-mode .last-update {
  color: rgba(255, 255, 255, 0.9);
}